<?php
/**
 * User: Administrator
 * Time: 2015/10/27 19:30
 */


$dom = simplexml_load_file('./test.xml');

echo $dom->getName() . "\n";

foreach ($dom->children() as $child)
{
	foreach($child->children() as $kids){
		echo $kids->getName().PHP_EOL;
	};
}


//$sxe = new SimpleXMLElement($xmlstr);
////添加属性
//$sxe->addAttribute('type', 'documentary');
////追加节点
//$movie = $sxe->addChild('movie');
////追加节点与文本
//$movie->addChild('title', 'PHP2: More Parser Stories');
//$movie->addChild('plot', 'This is all about the people who make it work.');
//$rating = $movie->addChild('rating', '5');
//$rating->addAttribute('type', 'stars');
//
//echo $sxe->asXML();
